<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .box{
            width: 200px;
            height: 200px;
        }
        .box1{
            background: yellow;
            position: absolute;
            top: 100px;
            left: 100px;
            z-index: 1;
        }
        .box2{
            background: darkmagenta;
            position: absolute;
            z-index: 2;
        }
        .box3{
            background: darkolivegreen;
            position: absolute;
            top: 50px;
            left: 50px;
            z-index: 3;
        }
    </style>
</head>
<body>
    <!-- 
        1. 定位优先级
            当多个定位之间发生重叠时,可通过z-index 调整优先级
            z-index: num数字      数字越大,优先级越高
            (属性限制:只能用于定位元素)
            默认情况下,后面的定位元素优先级比前面的定位元素高

     -->
    <div class="box box1"></div>
    <div class="box box2"></div>
    <div class="box box3"></div>
</body>
</html>